package com.icetech.eom.common.constant;

import lombok.Getter;

/**
 * 用户类型枚举
 */
public enum UserTypeEnum {
    admin(1,"超级管理员"),

    developer(4,"开发者"),
    operater(5,"操作者"),
    manager(6,"管理员"),
    custom_manager(7,"客户管理员"),

    register(3,"注册用户"),
    subuser(8,"子账户"),
    ;
    private @Getter Integer type;
    private @Getter String desc;
    UserTypeEnum(Integer type, String desc){
        this.type = type;
        this.desc = desc;
    }

    public static String getDescByType(Integer type){

        UserTypeEnum[] values = UserTypeEnum.values();
        for (int i = 0;i< values.length;i++){
            UserTypeEnum userTypeEnum =  values[i];
            if (userTypeEnum.getType() == type){
                return userTypeEnum.getDesc();
            }
        }
        return null;
    }
}
